#pragma once
#include <QGraphicsScene>

class AbstractManager;
class NodeItem;
class WOP_Entry;
class AbstractShapeItem;
class LineItem;
class GatesPanel;

class DiagramScene :
	public QGraphicsScene
{
	Q_OBJECT

public:
	DiagramScene(AbstractManager*);
	~DiagramScene(void);
	AbstractManager* getManager();
	WOP_Entry* getEntry();
	void setEntry(WOP_Entry*);
	void setSceneRect(qreal , qreal , qreal , qreal );
	void addItem( AbstractShapeItem* );
	void addItem( LineItem *);
	void addItem( QGraphicsItem * );
	void addInputPaneltoCanvas();
	void addOutputPanelToCanvas();
	
protected:
	void mousePressEvent(QGraphicsSceneMouseEvent* );
	void mouseReleaseEvent(QGraphicsSceneMouseEvent* );
	void mouseMoveEvent(QGraphicsSceneMouseEvent*);
	void keyPressEvent ( QKeyEvent* );

signals:
	void deleteNode(NodeItem*);

private:
	AbstractManager* _manager;
	WOP_Entry* _currentEntry;								//現在正在設定的entry
};
